package com.dxl.producer;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Description: 工作模式-生产者类
 *
 * @author: Yingyu Wei
 * <p>File Created at 2021/5/1</p>
 */
@Component
public class WorkProducer {


    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendMessage() {
        /**
         * String exchange: 交换机名称
         * String routingKey: 路由key(队列名称)
         * final Object object: 消息内容
         */
        rabbitTemplate.convertAndSend("","work-queue","工作队列模式的消息！！！！！");

    }

}
